﻿using RabbitMQ.Client.Events;
using System;
using System.Threading.Tasks;

namespace Fast.Extensions.RabbitMQ
{
    /// <summary>
    /// 消息消费
    /// </summary>
    public interface IRabbitMqMessageConsumer
    {
        /// <summary>
        /// 接收消息
        /// </summary>
        /// <param name="callback"></param>
        void OnMessageReceived(Func<BasicDeliverEventArgs, Task> callback);

        /// <summary>
        /// 开始消费
        /// </summary>
        /// <param name="context"></param>
        void StartBasicConsume(BasicConsumeContext context);
    }
}